<template>
  <div class="theme-active-text-color content">
    <div class="detail">
        <div class="detail_title">申请详情:</div>
        <div class="des">材料ID: {{detail.goods_id}}</div>
        <div class="des">材料名称: {{detail.name}}</div>
        <div class="des">申请数量: {{detail.count}}</div>
        <div class="des">采购单价: {{detail.price}}</div>
        <div class="des">采购商家: {{detail.merchant}}</div>
        <div class="des">申请人: {{detail.applyer}}</div>
        <div class="des">询价记录: {{detail.tips}}</div>
    </div>
    <div class="result">
        <div class="result_process">
          <el-steps :space="200" :active="complete" finish-status="success">
            <el-step title="采购部"></el-step>
            <el-step title="成本部"></el-step>
            <el-step title="商务部"></el-step>
            <el-step title="总助"></el-step>
            <el-step title="副总"></el-step>
            <el-step title="总经理"></el-step>
            <el-step title="完成"></el-step>
          </el-steps>
        </div>
        <div class="result_btn">审批部门: {{complete | completefilter }}</div>
        <div class="result_btn">审批意见:</div>
        <div class="result_btn"><el-input type="textarea" v-model="tips"></el-input></div>
        <div class="result_btn">审批结果:</div>
        <div class="result_btn"><el-button type="primary">同意申请</el-button><el-button type="danger">不同意</el-button></div>
        
    </div>
  </div>
</template>

<script>
import { applyDetailApi } from '@/api';

export default {
  name: "审批",
  components: {},
  data() {
    return {
      id:'',
      detail:{},
      tips:'',
      complete:0,
    };
  },
  created() {
    this.id = this.$route.query.id;
    this.applyDetail()
  },
  filters:{
    completefilter:function(val){
      switch (val){
        case 0:return '采购部'
        case 1: return "成本部"
        case 2: return "商务部"
        case 3: return "总助"
        case 4: return "副总"
        case 5: return "总经理"
        case 6: return "完成"
        default:
          return val
      }
    }
  },
  methods: {
    async applyDetail(){
      let res = await applyDetailApi({
        id:this.id
        })
      if(res){
        this.detail = res.data[0],
        this.complete = res.data[0].complete
      }
    },
     
  }
};
</script>
<style lang="less" scoped>
.content{
  width: 100%;
  height: 100%;
  background: #fff;
  box-sizing: border-box;
  font-size: .1rem;
  padding: 10px;
  display: flex;

  .detail{
    width: 5rem;
    height: 100%;
    background: rgb(238, 238, 237);
    box-sizing: border-box;
    padding: 10px;

    .detail_title{
      font-size: .15rem;
      color: rgb(92, 91, 91);
      font-weight: 600;
      padding: 20px;
      margin-bottom:20px;
      border-bottom: 1px solid rgb(192, 191, 191);
    }
    .des{
      font-size: .14rem;
      line-height: .26rem;
      padding-left: 20px;
      color: rgb(92, 91, 91);
    }
  }

  .result{
    width: 7rem;
    height: 100%;
    box-sizing: border-box;
    padding: 10px;

    .result_process{
      font-size: .15rem;
      color: rgb(92, 91, 91);
      font-weight: 600;
      padding: 20px;
    }
    .result_btn{
      font-size: .15rem;
      color: rgb(92, 91, 91);
      font-weight: 600;
      padding: 20px 0px 0px 20px;
    }
  }
}

</style>